//
//  NSString+SystemPath.m
//  download
//
//  Created by 陈曦 on 13-4-24.
//  Copyright (c) 2013年 陈曦. All rights reserved.
//

#import "NSString+SystemPath.h"

NSString* NSLibraryPath()
{
    return [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0];
}

NSString* NSLibraryAppendingPathComponent(NSString* aComponent)
{
    return [NSLibraryPath() stringByAppendingPathComponent:aComponent];
}

NSString* NSDocumentPath()
{
    return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
}

NSString* NSDocumentAppendingPathComponent(NSString* aComponent)
{
    return [NSDocumentPath() stringByAppendingPathComponent:aComponent];
}

@implementation NSString(SystemPath)

+ (NSString*)documentPath
{
    return NSDocumentPath();
}

+ (NSString*)documentPath:(NSString *)aComponent
{
    return NSDocumentAppendingPathComponent(aComponent);
}

+ (NSString*)libraryPath
{
    return NSLibraryPath();
}

+ (NSString*)libraryPath:(NSString *)aComponent
{
    return NSLibraryAppendingPathComponent(aComponent);
}



@end
